package org.easystub;

final class GlobalInvocationReporter {

    private GlobalInvocationReporter() {
    }

    private static Invocation last;

    static void report(Invocation invocation) {
        last = invocation;
    }

    static Invocation lastInvocation() {
        assertLastInvocationSet();
        return last;
    }

    private static void assertLastInvocationSet() {
        if(last == null) {
            throw new IllegalStateException("No invocations reported");
        }
    }
}
